#include<iostream>
using namespace std;
const int N = 1e5 + 3;
int n;
int h[N], e[N], ne[N];
int index;
void insert(int m)
{
	int k = (m % N + N) % N;
	e[index] = k;
	ne[index] = h[k];
	h[k] = index++;
}
bool find(int m)
{
	int k = (m % N + N) % N;
	for (int i = h[k]; i != -1; i=ne[i]) {
		if (e[i] == m) {
			return 1;
		}
	}
	return 0;
}
int main()
{
	cin >> n;
	memset(h, -1, sizeof(h));
	while (n--) {
		char op[2];
		cin >> op;
		if (op[0] == 'I') {
			int k;
			cin >> k;
			insert(k);
		}
		else {
			int k;
			cin >> k;
			if (find(k)) {
				cout << "Yes" << endl;
			}
			else {
				cout << "No" << endl;
			}
		}
	}
	return 0;
}